package com.jyb.qiyefuwu.viewmodel;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;

import com.jyb.qiyefuwu.api.EnterpriseServiceAPIManager;
import com.jyb.qiyefuwu.entity.IpPickSelectEntity;
import com.jyb.qiyefuwu.entity.ServiceSecondClassEntiy;
import com.sgb.net.entity.BaseEntity;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

import java.util.ArrayList;
import java.util.List;


public class EnterpriseFragModel extends AndroidViewModel {

    public EnterpriseFragModel(@NonNull Application application) {
        super(application);
    }

    public void getServerTitleLable() {
        EnterpriseServiceAPIManager.getInstance().getEnterPriseNewAPI().getserviceTitleLableForClass1().enqueue(new Callback<BaseEntity<List<ServiceSecondClassEntiy>>>() {
            @Override
            public void onResponse(Call<BaseEntity<List<ServiceSecondClassEntiy>>> call, Response<BaseEntity<List<ServiceSecondClassEntiy>>> response) {
                if (response.body() == null || response.body().getData() == null) {
                    return;
                }
                /*if (mFragment != null && response.body().getData().size() > 0) {
                    mFragment.initTopMenu(response.body().getData());
                }*/
            }

            @Override
            public void onFailure(Call<BaseEntity<List<ServiceSecondClassEntiy>>> call, Throwable t) {

            }
        });
    }


    public List<IpPickSelectEntity> getTypeData() {
        List<IpPickSelectEntity> list = new ArrayList<>();
        IpPickSelectEntity entity = new IpPickSelectEntity();
        entity.setName("商标需求");
        entity.setId("1");
        list.add(entity);
        IpPickSelectEntity entity1 = new IpPickSelectEntity();
        entity1.setName("专利需求");
        entity1.setId("3");
        list.add(entity1);
        IpPickSelectEntity entity2 = new IpPickSelectEntity();
        entity2.setName("版权需求");
        entity2.setId("2");
        list.add(entity2);
        IpPickSelectEntity entity3 = new IpPickSelectEntity();
        entity3.setName("服务需求");
        entity3.setId("4");
        list.add(entity3);
        return list;
    }
}
